package com.surveillance.tests;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.ArrayList;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.surveillance.BO.BOLayer;
import com.surveillance.BO.SalleBO;
import com.surveillance.entities.Etudiant;
import com.surveillance.entities.Salle;

public class PopulatingSalles {
	public static void main(String[] args) {
		ApplicationContext appContext = new ClassPathXmlApplicationContext(
				"beanLocations.xml");
		@SuppressWarnings("unchecked")
		BOLayer<Salle> salleBO = (BOLayer<Salle>) appContext.getBean("SalleBO");
		//Salle fetchedSalle = salleBO.findByID(new Long(1));
		//salleBO.delete(fetchedSalle);
		// salle1
		SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yyyy");
		Salle salle1 = new Salle();
		salle1.setCapaciteR(10);
		salle1.setCapaciteE(5);
		salle1.setDateDebutIndisponibilite(new Date());
		salle1.setDateFinIndisponibilite(new Date());
		salle1.setDesignation("amphie raziiiiii");
		salle1.setType("amphie");
		salleBO.save(salle1);
		// salle2
				/*Salle salle2 = new Salle();
				salle2.setCapacite(1);
				salle2.setDisponible(true);
				salle2.setDateDebutIndisponibilite(new Date());
				salle2.setDateFinIndisponibilite(new Date());
				salle2.setNumero(24);
				salle2.setType("salle");
				salleBO.save(salle2);*/
		/*Salle fetchedSalle = salleBO.findByID(new Long(2));
		fetchedSalle.setCapacite(2);
		salleBO.update(fetchedSalle);*/
		
	}
}
